#ifndef _DOOR_H_
#define _DOOR_H_

#include "actor.hpp"

struct Cue;

class Player;

class Door : public Actor
{
public:
	static const int COUNT = 3;

	static bool Open();

	void Init(float x, float y, Cue & cue);

	void Update();

	void Hit(Player & plr);

	float FrontX()
	{
		return pos.x + (dir < 0 ? body.AxMin(X) : body.AxMax(X));
	}

	float BackX()
	{
		return pos.x + (dir < 0 ? body.AxMax(X) : body.AxMin(X));	
	}

	void Shut(bool shut);
	bool IsShut();

	friend class Player;

private:
	float dframe;
};

extern ActPool<Door, Door::COUNT> Doors;

#endif
